<?php
  $default_page = db_fetch("select * from page where parent_id = '0' and status = 'visiable' order by sort_order desc, id asc");
  if ($default_page) {
    $default_url = url('?module=page&page_id=' . $default_page['id']);
  } else { 
    $first_category = db_fetch("select * from category where parent_id = '0' and status = 'visiable' order by sort_order desc");
    if ($first_category) {
      $default_url = url('?module=category&category_id=' . $first_category['id']);
    } else {
      $default_url = url('?module=message');
    }
  }?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo SITE_NAME;?></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="content/theme/<?php echo THEME;?>/jquery.ad-gallery.js"></script>
<script type="text/javascript">
//$(function() {
//  var galleries = $('.ad-gallery').adGallery();
//});
</script>
<link href="content/theme/<?php echo THEME;?>/default.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" href="content/theme/<?php echo THEME;?>/jquery.ad-gallery.css" />
</head>
<body onload="$('.ad-gallery').adGallery()">
<div class="container_index">
  <div class="header_index">
    <img src="content/theme/<?php echo THEME;?>/images/logo_index.gif" alt="" />
    <div class="header_test">仙人指成衣尽显您的高雅尊贵</div>
  </div>
  <div class="main_index">
    <div id="gallery" class="ad-gallery">
      <div class="ad-image-wrapper"></div>
      <a class="link_inkex" href="<?php echo $default_url;?>">进入网站</a>
      <div class="ad-controls">
      </div>
      <div class="ad-nav">
        <div class="ad-thumbs">
          <ul class="ad-thumb-list">
            <li>
              <a href="content/theme/<?php echo THEME;?>/ad-images/1.jpg">
                <img src="content/theme/<?php echo THEME;?>/ad-images/thumbs/t1.jpg" class="image0" alt="" />
              </a>
            </li>
            <li>
              <a href="content/theme/<?php echo THEME;?>/ad-images/2.jpg">
                <img src="content/theme/<?php echo THEME;?>/ad-images/thumbs/t2.jpg" class="image6" alt="" />
              </a>
            </li>
            <li>
              <a href="content/theme/<?php echo THEME;?>/ad-images/3.jpg">
                <img src="content/theme/<?php echo THEME;?>/ad-images/thumbs/t3.jpg" class="image7" alt="" />
              </a>
            </li>
            <li>
              <a href="content/theme/<?php echo THEME;?>/ad-images/4.jpg">
                <img src="content/theme/<?php echo THEME;?>/ad-images/thumbs/t4.jpg" class="image8" alt="" />
              </a>
            </li>
            <li>
              <a href="content/theme/<?php echo THEME;?>/ad-images/5.jpg">
                <img src="content/theme/<?php echo THEME;?>/ad-images/thumbs/t5.jpg" class="image9" alt="" />
              </a>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
  <div class="footer_index">版权所有 &copy; 仙人指服饰有限公司</div>
</div>
</body>
</html>
